from fastapi import APIRouter
from pydantic import BaseModel
from typing import Optional

router = APIRouter(
    prefix="/mobot",
    tags=["mobots"],
)


# code4

# MobotModel Class 继承 BaseModel
class MobotModel(BaseModel):
    title: str
    content: str
    published: Optional[bool]

# code5


@router.post('/new')
def create_mobot(mobot: MobotModel):
    return mobot
